package com.pingtai.indent.entity;

import java.io.Serializable;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
import java.util.Set;

import com.pingtai.user.entity.User;

public class UserIndentType implements Serializable {
	
	
	private static final long serialVersionUID = -3175783309893796872L;
	private Integer id;
	private Float price;
	private User user;
	private UserBaseIndentType userBaseIndentType;
	private UserIndentType parentIndentType;
	private int isOpen;
	private Set childrenIndentType;
	private boolean hasChild=false;
	private Integer userBaseIndentTypeId;
	private List childrenIndentTypeList;
	private Float defaultPrice;
	private Date updateDate;
	private Float basePrice;
	
	
	public Date getUpdateDate() {
		return updateDate;
	}
	public void setUpdateDate(Date updateDate) {
		this.updateDate = updateDate;
	}
	public Float getBasePrice() {
		return basePrice;
	}
	public void setBasePrice(Float basePrice) {
		this.basePrice = basePrice;
	}
	public Float getDefaultPrice() {
		return defaultPrice;
	}
	public void setDefaultPrice(Float defaultPrice) {
		this.defaultPrice = defaultPrice;
	}
	public List getChildrenIndentTypeList() {
		if(childrenIndentTypeList!=null&&childrenIndentTypeList.size()>0) return childrenIndentTypeList;
		List list = new ArrayList();
		Object[] objs = childrenIndentType.toArray();
		for(int i=0;i<objs.length;i++){
			list.add(objs[i]);
		}
		return list;
	}
	public void setChildrenIndentTypeList(List childrenIndentTypeList) {
		this.childrenIndentTypeList = childrenIndentTypeList;
	}
	public Integer getUserBaseIndentTypeId() {
		return userBaseIndentTypeId;
	}
	public void setUserBaseIndentTypeId(Integer userBaseIndentTypeId) {
		this.userBaseIndentTypeId = userBaseIndentTypeId;
	}
	
	public boolean isHasChild() {
		return hasChild;
	}
	public void setHasChild(boolean hasChild) {
		this.hasChild = hasChild;
	}
	public Set getChildrenIndentType() {
		return childrenIndentType;
	}
	public void setChildrenIndentType(Set childrenIndentType) {
		this.childrenIndentType = childrenIndentType;
	}
	public UserIndentType getParentIndentType() {
		return parentIndentType;
	}
	public void setParentIndentType(UserIndentType parentIndentType) {
		this.parentIndentType = parentIndentType;
	}
	public int getIsOpen() {
		return isOpen;
	}
	public void setIsOpen(int isOpen) {
		this.isOpen = isOpen;
	}
	public Integer getId() {
		return id;
	}
	public void setId(Integer id) {
		this.id = id;
	}
	public Float getPrice() {
		return price;
	}
	public void setPrice(Float price) {
		this.price = price;
	}
	public User getUser() {
		return user;
	}
	public void setUser(User user) {
		this.user = user;
	}
	public UserBaseIndentType getUserBaseIndentType() {
		return userBaseIndentType;
	}
	public void setUserBaseIndentType(UserBaseIndentType useBaseIndentType) {
		this.userBaseIndentType = useBaseIndentType;
	}
	
	public int getSort(){
		String sort_a;
		Integer classiz = userBaseIndentType.getBaseIndentTypeClassify().getSort();
		Integer typeSort = userBaseIndentType.getSort();
		sort_a = classiz.toString() + typeSort.toString();
		return new Integer(sort_a).intValue();
	}
	
	public int getSort2(){
		Integer typeSort = userBaseIndentType.getSort2();
		return typeSort.intValue();
	}

}
